import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

const demandPlanTypeMap = {
    0: '劳务需求',
    1: '设备需求'
}

//列表数据
export const columns: BasicColumn[] = [
  {
    title: '需求计划编号',
    align: "center",
    dataIndex: 'demandPlanCode'
  },
  {
    title: '需求计划类型',
    align: 'center',
    dataIndex: 'demandPlanType',
    customRender: ({text, record, index, column}) => {
        console.log(record)
        return demandPlanTypeMap[text]
    }
  },
  {
    title: '提报时间',
    align: 'center',
    dataIndex: 'reportingTime',
    customRender: ({text, record}) => {
        return text
    }
  },
  {
    title: '提报单位',
    align: 'center',
    dataIndex: 'reportingUnit'
  },
  {
    title: '状态',
    align: 'center',
    dataIndex: 'demandPlanStatus'
  },
  {
    title: '平台公司',
    align: 'center',
    dataIndex: 'platformCompany'
  }
];

export const searchFormSchema: FormSchema[] = [
    {
        label: '提报单位',
        field: 'reportingUnit',
        component: 'Select',
        componentProps: {
            placeholder: '请输入需求计划名称',
            options: [{
                label: '单位1',
                value: '1',
            }, {
                label: '单位2',
                value: '2',
            }]
        },
    },
    {
        label: '提报时间',
        field: 'reportingTime',
        component: 'DatePicker',
        componentProps: {
            placeholder: '请选择提报时间'
        }
    }
]

export const demandPlanTypeOptions = [
    {
        label: '劳务需求',
        value: 0
    },
    {
        label: '设备需求',
        value: 1
    }
]